home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 1.iso
/
DEMON
/
RISCOS2
/
TCP_131S.ARC
/
h
/
MBUF
< prev
next >
Wrap
Text File
|
1994-02-25
|
1KB
|
33 lines
/* Basic message buffer structure */
struct mbuf {
struct mbuf *next; /* Links mbufs belonging to single packets */
struct mbuf *anext; /* Links packets on queues */
int size; /* Size of associated data buffer */
char *data; /* Active working pointers */
int cnt;
};
#define NULLBUF (struct mbuf *)0
#define NULLBUFP (struct mbuf **)0
struct mbuf *alloc_mbuf(int);
struct mbuf *free_mbuf(struct mbuf *);
struct mbuf *free_p(struct mbuf *);
void free_q(struct mbuf **);
int len_mbuf(struct mbuf *);
int len_q(struct mbuf *);
void trim_mbuf(struct mbuf **, int);
int dup_p(struct mbuf **, struct mbuf *, int, int);
struct mbuf *copy_p(struct mbuf *, int);
int pullone(struct mbuf **, char *);
int pullup(struct mbuf **, char *, int);
void append(struct mbuf **, struct mbuf *);
struct mbuf *pushdown(struct mbuf *, int);
void enqueue(struct mbuf **, struct mbuf *);
struct mbuf *dequeue(struct mbuf **);
struct mbuf *qdata(char *, int);
int dqdata(struct mbuf *, char *, unsigned int);
int32 pull32(struct mbuf **);
int pull16(struct mbuf **);
char pullchar(struct mbuf **);